extends ../public/layout
block title
    title 我的购物车
block content
    .am-g.white-background.am-margin-bottom-sm
        .am-u-sm-12.am-text-center.am-padding-sm 购物车
            if !isNull
                span.am-fr.theme-color.editCart 编辑
    if !isNull
        each products,shop in cartList
            .am-container.white-background.am-margin-bottom-sm(data-shop-order=1)
                .am-g.border-bottom-add.md-line-height.border-top-add
                    .am-u-sm-1
                        i.am-inline-block.shopChoose.uncheck-icon
                    .am-u-sm-11
                        i.am-inline-block.shop-icon
                        span.gray-color #{shop}
                each product in products
                    .am-g.cart-shop-pro.am-padding-sm(data-cartProId="#{product.objectId}" data-productId="#{product.product.objectId}")
                        i.am-inline-block.proChoose.uncheck-icon
                        a(href="/product/#{product.product.objectId}")
                            img.img-responsive(src = "#{__IMAGE_HOST__}#{product.product.images}")
                        div.cart-list
                            p.am-margin-top-0.am-margin-bottom.pro-title #{product.product.title}
                            p.am-margin-bottom-0
                                span.money-color.am-fr.md-font ￥
                                    i.proPrice #{product.product.salePrice}
                                span.am-inline-block.editBox ×
                                    i.proNum #{product.count}
    else
        .emptyMsg
            .empty-Cart
    .am-g.white-background.flex.cart-fixed
        .am-u-sm-3
            div.chooseAllNone.am-hide
                i.am-inline-block.am-margin-right-sm.uncheck-icon.chooseAll
                | 全选
        .am-u-sm-5.am-text-right
            | 合计
            span.money-color ￥
                i.totalPrice 0
        .am-u-sm-4.am-padding-0
            a.am-btn.md-font.settleCart.py-btn#Cart 结算(
                span.totalSort 0
                |)
    #delete.am-modal.am-modal-confirm(tabindex='-1')
        .am-modal-dialog
            .am-modal-bd
                | 确认删除选中商品吗？
            .am-modal-footer
                span.am-modal-btn(data-am-modal-cancel='') 取消
                span.am-modal-btn(data-am-modal-confirm='') 确认
    i#loading.am-inline-block.am-icon-spinner.am-icon-pulse.loading.theme-color.lg-font
block javascript
    script(type="text/javascript" src = "/bower_components/amazeui/dist/js/amazeui.min.js")
    script(type="text/javascript" src = "/public/javascripts/cart.js")
    script(type="text/javascript").
        $(function(){
           cart.init();
        });

